package database.dao;

import java.sql.PreparedStatement;
import java.sql.SQLException;

import database.manager.DatabaseManager;

public class HumidityDAO {

	private static final String	setHumidity	= "INSERT INTO HumidityValues VALUES( ?, ? )";

	public static void setHumidity( int humidity ) throws SQLException {
		java.util.Date date = new java.util.Date();
		long dateLong = date.getTime();

		java.sql.Timestamp dateTime = new java.sql.Timestamp( dateLong );
		PreparedStatement ppstm = DatabaseManager.getInstance().getConnection().prepareStatement( setHumidity );
		ppstm.setTimestamp( 1, dateTime );
		ppstm.setInt( 2, humidity );

		ppstm.execute();
	}
}
